#include "linux/device.h"
#include "linux/slab.h"
#include "linux/printk.h"
#include "linux/of.h"

struct device *imx_soc_device_init(void)
{
	struct device_node *root;
    struct device *dev;

	root = of_find_node_by_path("/");
	if (!root)
    {

    }

    dev = (struct device *)kzalloc(sizeof(struct device), GFP_KERNEL);
    if (!dev)
    {
        printk("Failed to allocate device structure\n");
        return NULL;
    }
    memset(dev, 0, sizeof(struct device));
    dev->init_name = "imx-soc";
    dev->bus = (struct bus_type *)kzalloc(sizeof(struct bus_type), GFP_KERNEL);
    if (!dev->bus)
    {
        printk("Failed to allocate bus structure\n");
        kfree(dev);
        return NULL;
    }
    memset(dev->bus, 0, sizeof(struct bus_type));
    dev->bus->name = "imx-soc";
    dev->bus->dev_name = "imx-soc";
    dev->bus->dev_root = dev;
    dev->of_node = root;
    dev->parent = NULL;
    dev->platform_data = NULL;

    return dev;
}


